<?php	namespace Home\Controller;
use Hdphp\Controller\Controller;
class CommonController extends Controller
{
	public function __construct()
	{
		parent::__construct();
		//头部共享
		$headcateData = Db::table('cate')->where('cfid',0)->limit(5)->get();
//		p($headcateData);
		foreach ($headcateData as $k => $v) {
			$headcateData[$k]['ziji'] = Db::table('cate')->where('cfid',$v['cid'])->get();
		}
		View::with('headcateData',$headcateData);
		//分类
		$cateData = Db::table('cate')->where('cfid',0)->get();
		foreach ($cateData as $k => $v) {
			$cateData[$k]['ziji'] = Db::table('cate')->where('cfid',$v['cid'])->get();
		}
//		p($cateData);
		View::with('cateData',$cateData);
		//获取男装子级
		$nanzData = Db::table('cate')->where('cfid',1)->get();
//		p($nanzData);
		View::with('nanzData',$nanzData);
		//获取女装
		$nvzData = Db::table('cate')->where('cfid',2)->get();
//		p($nvzData);
		View::with('nvzData',$nvzData);
		$qicData = Db::table('cate')->where('cfid',17)->get();
//		p($qicData);
		View::with('qicData',$qicData);
	}
}
